<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@ include file="../common/commonCssJs.jsp" %>
<script type="text/javascript">
	function login() {
		var re_id = /^[a-z0-9_-]{6,10}$/; // 아이디 검사식
		var re_pw = /^[a-z0-9_-]{6,10}$/; // 비밀번호 검사식
		var
			id = $('#id'),
			password = $('#password');
		
		if (re_id.test(id.val()) != true) { 
			alert('[ID 입력 오류] 유효한 ID를 입력해 주세요.');
			id.focus();
			return false;
		} else if(re_pw.test(password.val()) != true) { 
			alert('[PW 입력 오류] 유효한 PW를 입력해 주세요.');
			password.focus();
			return false;
		}	
	}
</script>
</head>

<body>
<div id="wapper">
	<header>
	<%@ include file="../common/layout/header.jsp"%>
	</header>
	
	<nav>
	<%@ include file="../common/layout/nav.jsp"%>
	</nav>
	
	<aside>
	<%@ include file="../common/layout/aside.jsp"%>
	</aside>
	
	<section>
	<form action="/admin/app/login/login" method="POST" onsubmit="return login();">
	<table>
		<tr>
			<td>아이디</td>
			<td><input type="text" id="id" name="id" size="10" /></td>
			<td></td>
		</tr>
		<tr>
			<td>비밀번호</td>
			<td><input type="password" id="password" name="password" size="10" /> </td>
			<td><input type="submit" value="로그인" /> </td>
		</tr>
	</table>
	</form>
	</section>
	
	<footer>
	<%@ include file="../common/layout/footer.jsp"%>
	</footer>
</div>
	
<script type="text/javascript">
	$(function() {
		$("#id").focus();
	});
</script>
</body>
</html>